﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CallCenter.DAL;
using CallCenter.Model;

namespace CallCenter.BLL
{
    class ScriptBLL
    {
        ScriptDAL dal = new ScriptDAL();
        public ScriptsModel[] GetByParentId(int parentId)
        {
            return dal.GetByParentId(parentId); 
        }

        public bool UpdateById(ScriptsModel model)
        {
            int i = dal.Update(model);
            if (i <= 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }

        public int AddNew(ScriptsModel model)
        {
            return dal.AddNew(model);
        }

        public void DeleteAllNodes(int id)
        {
            dal.DeleteAllNode(id);
        }
    }
}
